{block name="title" prepend}{$LNG.lm_buildings}{/block}
{block name="content"}
<table style="width:780px">
<tr><td colspan="3" style="border:#333 1px solid; border-radius:2px; background:none"><div id="poli" style="width:{$raz}%"><span>
 Поля: <a style="cursor:help;" title="Занято полей на планете">{$planet_field_current}</a> / <a style="cursor:help;" title="Количество полей на планете">{$planet_field_max}</a> Свободно: <a style="color:#FC0">{$planet_field_max - $planet_field_current}</a></span></div>
        </td>
    </tr>
  	{$td=3}
	{foreach $BuildInfoList as $ID => $Element}
        {if $td==3}
            <tr>
                <td>
             {$td=0}
         {else} 
         	<td>
         {/if}      
            {$td= $td +1}
	<table class="b_box">
      <tr>
		<td rowspan="3" style="width:60px;">
			<a href="#" onclick="return Dialog.info({$ID})">
				<img src="{$dpath}gebaeude/{$ID}.gif" alt="{$LNG.tech.{$ID}}" width="60" height="60">
			</a>
		</td>
		<td>
			<a href="#" onclick="return Dialog.info({$ID})">{$LNG.tech.{$ID}}<br />{if $Element.level > 0} ({$LNG.bd_lvl} {$Element.level}{if $Element.maxLevel != 255}/{$Element.maxLevel}{/if}){/if} </a> 
            
		</td>
	</tr>
    <tr>
    	<td style="text-align:left;">
        	<img src="{$dpath}images/921.gif" alt="{$LNG.tech.921}" height="20" />
             <span style="font-weight:bold; {if $darkmatter >= $Element.costTM}color:#0F0;{else} color:#F00;{/if}">
            	{$Element.costTM|number}
         	</span>
        </td>
    </tr>
	<tr>
		<td>
                        {if $Element.maxLevel == $Element.level}
                            <span style="color:red">{$LNG.bd_maxlevel}</span>
                        {else}
                        	{if ($planet_field_max - $planet_field_current) > 0}
                                {if $darkmatter >= $Element.costTM}
                                    <form action="game.php?page=dmbuild&amp;mode=up" method="post">
                                        <input type="hidden" name="build" value="{$ID}">
                                        <button type="submit">
                                            <span style="color:#FC0">Улучшить до <span style="color:#F30">{$Element.level + 1}</span></span>
                                        </button>
                                    </form>
                                    {else}
                                        <a href='game.php?page=trader&amp;mode=obmen'><span style="font-weight:bold; color:#0F0">{$LNG.replenish} ТМ</span></a>
                                    {/if}
                             {else}
                             	<a href='game.php?page=planet'><span style="font-weight:bold; color:#0F0">Увеличить кол-во полей</span></a>
                             {/if}  
                        {/if}
		</td>
	</tr>
    </table>
    {if $td==3}
        </td>
    </tr>
    {else} 
        </td>
    {/if} 
	{/foreach}
        {if $td!=3}
    </tr>
    {/if}
</table>
{/block}